'\" t
.\"     Title: function::matched
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: November 2022
.\"    Manual: A collection of standard string functions
.\"    Source: SystemTap Tapset Reference
.\"  Language: English
.\"
.TH "FUNCTION::MATCHED" "3stap" "November 2022" "SystemTap Tapset Reference" "A collection of standard strin"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
function::matched \- Return a given matched subexpression\&.
.SH "SYNOPSIS"
.sp
.nf
    matched:string(n:long)
.fi
.SH "ARGUMENTS"
.PP
\fIn\fR
.RS 4
index to the subexpression to return\&. 0 corresponds to the entire regular expression\&.
.RE
.SH "DESCRIPTION"
.PP
returns the content of the n\*(Aqth subexpression of the last successful use of the =~ regex matching operator\&. Returns an empty string if the n\*(Aqth subexpression was not matched (e\&.g\&. due to alternation)\&. Throws an error if the last use of =~ was a failed match, or if fewer than n subexpressions are present in the original regexp\&.
.SH SEE ALSO\n 
.IR tapset::regex (3stap)
